using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class CustomerBatchPickMap : EntityTypeConfiguration<CustomerBatchPick>
	{
		public CustomerBatchPickMap()
		{
			// Primary Key
			this.HasKey(t => t.AutoID);

			// Properties
			this.Property(t => t.BatchPickCode)
				.IsRequired()
				.HasMaxLength(50);
				
			this.Property(t => t.BatchPickPosition)
				.IsRequired()
				.HasMaxLength(50);
				
			this.Property(t => t.HouseCode)
				.IsRequired()
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("CustomerBatchPick");
			this.Property(t => t.AutoID).HasColumnName("AutoID");
			this.Property(t => t.FormCode).HasColumnName("FormCode");
			this.Property(t => t.BatchPickCode).HasColumnName("BatchPickCode");
			this.Property(t => t.BatchPickPosition).HasColumnName("BatchPickPosition");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.HouseCode).HasColumnName("HouseCode");
		}
	}
}

